<template>
    <div>
      <div v-if="!isIframeLoaded" class="loading">正在加载请稍候...</div>
      <iframe ref="fastgptIframe" v-show="isIframeLoaded" @load="onIframeLoad" src="http://localhost:3000/dataset/list" width="100%"
        height="100%" />
    </div>
  </template>
  
  <script>
  export default {
    name: 'FastGPT',
    data() {
      return {
        isIframeLoaded: false
      }
    },
    methods: {
      onIframeLoad() {
        console.log('iframe加载完成')
        this.isIframeLoaded = true
      }
    }
  }
  </script>
  
  <style scoped>
  iframe {
    width: 100%;
    height: calc(100vh - 100px);
  }
  
  .loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: calc(100vh - 100px);
    font-size: 18px;
    color: #409eff;
  }
  </style>
  